/**
 * 用户路由
 * @module routes/user
 */

const express = require('express');
const router = express.Router();
const userController = require('../controllers/user.controller');
const authMiddleware = require('../middlewares/auth.middleware');
const validation = require('../middlewares/validation.middleware');

// 所有路由都需要认证
router.use(authMiddleware.authenticate);

// 获取用户个人信息
router.get('/profile', userController.getProfile);

// 更新用户个人信息
router.put('/profile', validation.validateUpdateProfile, userController.updateProfile);

module.exports = router; 